package Test;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class client1 {
	static Socket s=null;
	public static void a() throws Exception{
		InputStream is=s.getInputStream();
		byte b[]=new byte[1024];
		int i=is.read(b);
		String string=new String(b,0,i);
		System.out.println(string);
	}
	public static void b() throws Exception{
		OutputStream os=s.getOutputStream();
		Scanner sc=new Scanner(System.in);
		String string=sc.next();
		os.write(string.getBytes());
	
	}
	public static void main(String[] args) throws  Exception {
		// TODO Auto-generated method stub
		client1 client=new client1();
		while(true){
			s=new Socket("127.0.0.1",8990);
			client.b();
			client.a();
		}
	}

}
